<div style="clear:both;"></div>
<!-- 头部 start -->
<div class="header w1210 bc mt15">
    <!-- 头部上半部分 start 包括 logo、搜索、用户中心和购物车结算 -->
    <div class="logo w1210">
        <h1 class="fl"><a href="{:U('Index/index')}"><img src="__PUBLIC__/Home/images/logo.png" alt="京西商城"></a></h1>
        <!-- 头部搜索 start -->
        <div class="search fl">
        <div class="search_form">
            <div class="form_left fl"></div>
            <form  name="search" method="get" class="fl">
                <input id="key" name="key" type="text" class="txt"
                       value="<?php echo I('get.key','请输入商品关键字')?>"/>
                <input onclick="location.href='<?php echo U('Search/key_search', '',FALSE); ?>/key/'+$('#key').val();" type="button" class="btn" value="搜索" />
            </form>
            <div class="form_right fl"></div>
        </div>

        <div style="clear:both;"></div>

        <div class="hot_search">
            <strong>热门搜索:</strong>
            <a href="">D-Link无线路由</a>
            <a href="">休闲男鞋</a>
            <a href="">TCL空调</a>
            <a href="">耐克篮球鞋</a>
        </div>
    </div>
        <!-- 头部搜索 end -->

        <!-- 用户中心 start-->
        <div class="user fl">
            <dl>
                <dt>
                    <em></em>
                    <a href="">用户中心</a>
                    <b></b>
                </dt>
                <dd>
                    <div class="prompt">
                        您好，请<a href="">登录</a>
                    </div>
                    <div class="uclist mt10">
                        <ul class="list1 fl">
                            <li><a href="">用户信息></a></li>
                            <li><a href="">我的订单></a></li>
                            <li><a href="">收货地址></a></li>
                            <li><a href="">我的收藏></a></li>
                        </ul>

                        <ul class="fl">
                            <li><a href="">我的留言></a></li>
                            <li><a href="">我的红包></a></li>
                            <li><a href="">我的评论></a></li>
                            <li><a href="">资金管理></a></li>
                        </ul>

                    </div>
                    <div style="clear:both;"></div>
                    <div class="viewlist mt10">
                        <h3>最近浏览的商品：</h3>
                        <ul id="navhistory">
                        </ul>
                    </div>
                </dd>
            </dl>
        </div>
        <!-- 用户中心 end-->

        <!-- 购物车 start -->
        <div class="cart fl" >
            <dl>
                <dt>
                    <a  id="cart_list" href="{:U('Cart/lst')}">去购物车结算</a>
                </dt>
                <dd>
                    <div class="prompt" id="cart_div_list">
                        <img href="#" src ="__PUBLIC__/Home/images/loading.gif"/>
                    </div>
                </dd>
            </dl>
        </div>
        <!-- 购物车 end -->
    </div>
    <!-- 头部上半部分 end -->

    <div style="clear:both;"></div>

    <!-- 导航条部分 start -->
    <div class="nav w1210 bc mt10">
        <!--  商品分类部分 start-->
        <div class="category fl <?php if($_show_nav==0) echo 'cat1'?>" >
            <div class="cat_hd <?php if($_show_nav==0) echo 'off'?>">  <!-- 注意，首页在此div上只需要添加cat_hd类，非首页，默认收缩分类时添加上off类，鼠标滑过时展开菜单则将off类换成on类 -->
                <h2>全部商品分类</h2>
                <em></em>
            </div>

            <div class="cat_bd <?php if($_show_nav==0) echo 'none'?>" >
                <?php foreach($catData as $k => $v):?>
                <div class="cat <?php if($_show_nav==0) echo 'item1'?>">
                    <h3><a href="<?php echo U('Search/cat_search?cat_id='.$v['id'],'',FALSE)?>"><?php echo $v['cate_name']?></a> <b></b></h3>
                    <div class="cat_detail none">
                        <?php foreach($v['children'] as $k1 => $v1):?>
                        <dl <?php if($k1 ==0 ) echo 'class =dl_lst'?>>
                            <dt><a href="<?php echo U('Search/cat_search?cat_id='.$v1['id'],'',FALSE)?>"><?php echo $v1['cate_name']?></a></dt>
                            <dd>
                               <?php foreach($v1['children'] as $k2 => $v2):?>
                            <a href="<?php echo U('Search/cat_search?cat_id='.$v2['id'],'',FALSE)?>"><?php echo $v2['cate_name']?></a>
                                <?php endforeach?>
                            </dd>
                        </dl>
                        <?php endforeach?>
                    </div>
                </div>
                <?php endforeach?>
            </div>
        </div>
        <!--  商品分类部分 end-->

        <div class="navitems fl">
            <ul class="fl">
                <li class="current"><a href="">首页</a></li>
                <li><a href="">电脑频道</a></li>
                <li><a href="">家用电器</a></li>
                <li><a href="">品牌大全</a></li>
                <li><a href="">团购</a></li>
                <li><a href="">积分商城</a></li>
                <li><a href="">夺宝奇兵</a></li>
            </ul>
            <div class="right_corner fl"></div>
        </div>
    </div>
    <!-- 导航条部分 end -->
</div>
<!-- 头部 end-->
<div style="clear:both;"></div>
<script>
    <?php $ic=C('IMAGE_CONFIG');?>
    var picView ="<?php echo $ic['viewPath']?>";
    $("#cart_list").mouseover(function () {
        $.ajax({
            type:'GET',
            url:"<?php echo U('Cart/ajaxCartList')?>",
            dataType:'json',
            success:function (data) {
                var html ="<table style='background-color: ivory'>";
                $(data).each(function (k,v) {
                    html +="<tr>";
                    html +='<td style="width: 100px"><img href="#" width="50" src="'+picView+v.mid_logo+'" /></td>';
                    html +='<td>'+v.goods_name+'</td>';
                    html +='</tr>'
                });
                html +='<table>';
                $('#cart_div_list').html(html);
            }
        })
    });

    <?php $config =C('IMAGE_CONFIG')?>
    var viewPath ='<?php echo $config['viewPath']?>';
    $.ajax({
        type: 'GET',
        url: "<?php echo U('Index/displayHistory?id='.$info['id'])?>",
        dataType: 'json',
        success:function (data) {
            var html = "";
            $(data).each(function (k,v) {
                html +='<li><a href="<?php echo U('Index/goods','',FALSE); ?>/id/'+v.id+'"><img src=" '+viewPath+v.mid_logo+'"/></a>' +
                '<a href="<?php echo U('Index/goods','',FALSE);?>/id/'+v.id +'">'+v.goods_name+'</a></li>';
            });
            $("#navhistory").html(html);
        }
    });

    </script>